package com.chrray.position.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.chrray.position.enums.YesNoEnum;
import com.chrray.position.enums.app.FdGenderEnum;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

/**
 * 用户个人认证信息 对象
 *
 * @author wusiwee
 * @email wusiwee@163.com
 * @since 1.0.1 2024-08-07
 */

@Data
@ApiModel(description = "用户个人认证信息")
@TableName("fd_auth_personal")
public class FdAuthPersonal extends Model<FdAuthPersonal> {
	@ApiModelProperty(value = "主键")
	@TableId(type = IdType.AUTO)
	private Long id;

	@ApiModelProperty(value = "用户id")
	private Long userId;

	@ApiModelProperty(value = "身份证人像照片")
	private String faceImg;

	@ApiModelProperty(value = "姓名")
	private String name;

	@ApiModelProperty(value = "身份证地址")
	private String addr;

	@ApiModelProperty(value = "出生年份")
	private Integer birthYear;

	@ApiModelProperty(value = "性别:1-男,2-女,3-不限")
	private Integer gender;

	@ApiModelProperty(value = "身份证号")
	private String idNo;

	@ApiModelProperty(value = "认证时间")
	private Date createTime;

	private Integer delFlag;


	public FdAuthPersonal findOneByUserId(Long userId) {
		LambdaQueryWrapper<FdAuthPersonal> query = new LambdaQueryWrapper<>();
		query.eq(FdAuthPersonal::getUserId, userId);
		return this.selectOne(query);
	}

}
